package com.cqc.other.juc.volatil.demo1;

public class DataEntity {

    private volatile boolean flag = true;

    public void add() {
        System.out.println("add()开始");
        while (flag) {

        }
        System.out.println("add()结束");
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }
}
